package com.myapplication.ui.homefragment.activities;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ImageButton;
import android.widget.ImageView;

import com.myapplication.R;

/**
 * Created by zitaojiang on 2016/10/17.
 */
public class Activity_Item1 extends AppCompatActivity {
    private ImageView iv_setting_back;
    private int num=0;
    private ImageButton rb_tuisong;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_item1);
        iv_setting_back= (ImageView) findViewById(R.id.iv_setting_back);
        rb_tuisong= (ImageButton) findViewById(R.id.rb_tuisong);
        rb_tuisong.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

                if(num%2==0){
                    rb_tuisong.setBackgroundResource(R.mipmap.ic_on);
                    num++;
                }else{
                    rb_tuisong.setBackgroundResource(R.mipmap.ic_off);
                    num--;
                }
            }
        });
    }
    public void click(View view) {
        switch (view.getId()) {
            case R.id.iv_setting_back:
                finish();
                break;
            case R.id.tv_erweima:
//                Intent intent=new Intent(Activity_Item1.this, CaptureActivity.class);
//                startActivityForResult(intent,0);
                break;
        }
    }
}
